package ace.module.oauth2.server.sdk.core.feign.model.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.Map;
import java.util.Set;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * oauth2 access token 标准数据结构.
 *
 * @author caspar
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(title = "Access Token Object")
public class Oauth2AccessTokenStandardDto {

  @JsonProperty(value = "access_token")
  @Schema(title = "access token value")
  private String accessToken;

  @JsonProperty(value = "token_type")
  @Schema(title = "access token type")
  private String accessType;

  @JsonProperty(value = "id_token")
  @Schema(title = "id token")
  private String idToken;

  @JsonProperty(value = "scopes")
  @Schema(title = "access token scope")
  private Set<String> scopes;

  @JsonProperty(value = "expires_in")
  @Schema(title = "expire in seconds")
  private Long expiresIn;

  @JsonProperty(value = "refresh_token")
  @Schema(title = "refresh token value")
  private String refreshToken;

  @JsonProperty(value = "attributes")
  @Schema(title = "access token attributes")
  private Map<String, String> attributes;
}
